package com.example.a10908.retorfitrxjava.presenter;

import com.example.a10908.retorfitrxjava.callback.ListviewDataCallBack;
import com.example.a10908.retorfitrxjava.model.IListNetWorkModel;
import com.example.a10908.retorfitrxjava.model.bean.ListBean;
import com.example.a10908.retorfitrxjava.ui.view.MianView;

/**
 * Created by 10908 on 2016/12/16.
 */

public class Presenter_Main implements ListviewDataCallBack {
    private MianView mianView;
    private IListNetWorkModel iListNetWorkModel;

    public Presenter_Main(MianView mianView) {
        this.mianView = mianView;
        iListNetWorkModel = new IListNetWorkModel(this);
    }

    public void setNetWorkpath(String path) {
        iListNetWorkModel.startNetWork(path);
    }

    @Override
    public void getDataSuccess(ListBean listBean) {
        mianView.setListBean(listBean);
    }

    @Override
    public void getDataError(String e) {
        mianView.httpError(e);
    }
}
